home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / mac / DirectX SDK / DXSDK / include / DShowIDL / amstream.idl next >
Text File  |  2001-10-08  |  9KB  |  337 lines

  1. //------------------------------------------------------------------------------
  2. // File: AMStream.idl
  3. //
  4. // Desc: 
  5. //
  6. // Copyright (c) 1998-2001, Microsoft Corporation.  All rights reserved.
  7. //------------------------------------------------------------------------------
  8.  
  9.  
  10. import "unknwn.idl";
  11. import "mmstream.idl";
  12. import "strmif.idl";
  13.  
  14. cpp_quote("#include <ddraw.h>")
  15. cpp_quote("#include <mmsystem.h>")
  16. cpp_quote("#include <mmstream.h>")
  17. cpp_quote("#include <ddstream.h>")
  18. cpp_quote("#include <austream.h>")
  19.  
  20.  
  21.  
  22. interface IAMMultiMediaStream;
  23. interface IAMMediaStream;
  24. interface IMediaStreamFilter;
  25. interface IDirectDraw;
  26. interface IDirectDrawSurface;
  27. interface IAMMediaTypeStream;
  28. interface IAMMediaTypeSample;
  29.  
  30. //  Flags definitions for IAMMultiMediaStream::Initialize
  31. enum {
  32.     AMMSF_NOGRAPHTHREAD      = 0x00000001
  33. };
  34.  
  35. //  Flags definitions for AddMediaStream and IAMMediaStream::Initialize
  36. enum {
  37.     //  Don't add a stream - create a default renderer instead
  38.     //  for the supplied purpose id
  39.     AMMSF_ADDDEFAULTRENDERER = 0x00000001,
  40.     AMMSF_CREATEPEER         = 0x00000002,
  41.  
  42.     //  If no samples are created when we run or the last sample
  43.     //  is deleted then terminate this stream
  44.     AMMSF_STOPIFNOSAMPLES    = 0x00000004,
  45.  
  46.     //  If Update is not called keep going
  47.     AMMSF_NOSTALL            = 0x00000008
  48. };
  49.  
  50.  
  51. //  Flag definitions for OpenFile and OpenMoniker
  52. enum {
  53.     AMMSF_RENDERTYPEMASK     = 0x00000003,
  54.     AMMSF_RENDERTOEXISTING   = 0x00000000,
  55.     AMMSF_RENDERALLSTREAMS   = 0x00000001,
  56.     AMMSF_NORENDER           = 0x00000002,
  57.  
  58.     AMMSF_NOCLOCK            = 0x00000004,
  59.     AMMSF_RUN                = 0x00000008
  60. };
  61.  
  62.  
  63. typedef [v1_enum] enum {
  64.     Disabled = 0,
  65.     ReadData = 1,
  66.     RenderData = 2
  67. } OUTPUT_STATE;
  68.  
  69.  
  70. [
  71. object,
  72. uuid(7DB01C96-C0C3-11d0-8FF1-00C04FD9189D),
  73. dual,
  74. helpstring("IDirectShowStream Interface"),
  75. pointer_default(unique)
  76. ]
  77. interface IDirectShowStream : IDispatch
  78. {
  79.     [propget, id(1), helpstring("property FileName")] HRESULT FileName([out, retval] BSTR *pVal);
  80.     [propput, id(1), helpstring("property FileName")] HRESULT FileName([in] BSTR newVal);
  81.     [propget, id(2), helpstring("property Video")] HRESULT Video([out, retval] OUTPUT_STATE *pVal);
  82.     [propput, id(2), helpstring("propetry Video")] HRESULT Video([in] OUTPUT_STATE newVal);
  83.     [propget, id(3), helpstring("property Audio")] HRESULT Audio([out, retval] OUTPUT_STATE *pVal);
  84.     [propput, id(3), helpstring("propetry Audio")] HRESULT Audio([in] OUTPUT_STATE newVal);
  85. };
  86.  
  87.  
  88. // IAMMultiMediaStream interface
  89. [
  90. object,
  91. uuid(BEBE595C-9A6F-11d0-8FDE-00C04FD9189D),
  92. pointer_default(unique)
  93. ]
  94. interface IAMMultiMediaStream : IMultiMediaStream
  95. {
  96.     HRESULT Initialize(
  97.         [in] STREAM_TYPE StreamType,
  98.         [in] DWORD dwFlags,
  99.         [in]  IGraphBuilder *pFilterGraph);
  100.  
  101.     HRESULT GetFilterGraph(
  102.         [out] IGraphBuilder **ppGraphBuilder);
  103.  
  104.     HRESULT GetFilter(
  105.         [out] IMediaStreamFilter **ppFilter);
  106.  
  107.     HRESULT AddMediaStream(
  108.         [in]  IUnknown *pStreamObject,
  109.         [in]  const MSPID *PurposeId,
  110.         [in]  DWORD dwFlags,
  111.         [out] IMediaStream **ppNewStream);
  112.  
  113.     HRESULT OpenFile(
  114.         [in] LPCWSTR pszFileName,
  115.         [in] DWORD dwFlags);
  116.  
  117.     HRESULT OpenMoniker(
  118.         [in] IBindCtx *pCtx,
  119.         [in] IMoniker *pMoniker,
  120.         [in] DWORD dwFlags);
  121.  
  122.     HRESULT Render(
  123.         [in] DWORD dwFlags);
  124. }
  125.  
  126.  
  127. // IAMMediaStream interface
  128. [
  129. object,
  130. uuid(BEBE595D-9A6F-11d0-8FDE-00C04FD9189D),
  131. pointer_default(unique)
  132. ]
  133. interface IAMMediaStream : IMediaStream
  134. {
  135.     HRESULT Initialize(
  136.         [in]  IUnknown *pSourceObject,
  137.         [in] DWORD dwFlags,
  138.         [in] REFMSPID PurposeId,
  139.         [in] const STREAM_TYPE StreamType);
  140.  
  141.     HRESULT SetState(
  142.         [in] FILTER_STATE State);
  143.  
  144.     HRESULT JoinAMMultiMediaStream(
  145.         [in] IAMMultiMediaStream *pAMMultiMediaStream);
  146.  
  147.     HRESULT JoinFilter(
  148.         [in] IMediaStreamFilter *pMediaStreamFilter);
  149.  
  150.     HRESULT JoinFilterGraph(
  151.         [in] IFilterGraph *pFilterGraph);
  152. };
  153.  
  154.  
  155.  
  156.  
  157. // IMediaStreamFilter interface
  158. [
  159. object,
  160. local,
  161. uuid(BEBE595E-9A6F-11d0-8FDE-00C04FD9189D),
  162. pointer_default(unique)
  163. ]
  164. interface IMediaStreamFilter : IBaseFilter
  165. {
  166.     HRESULT AddMediaStream(
  167.         [in] IAMMediaStream *pAMMediaStream);
  168.  
  169.     HRESULT GetMediaStream(
  170.         [in] REFMSPID idPurpose,
  171.         [out] IMediaStream **ppMediaStream);
  172.  
  173.     HRESULT EnumMediaStreams(
  174.         [in] long Index,
  175.         [out] IMediaStream **ppMediaStream);
  176.  
  177.         HRESULT SupportSeeking(
  178.         [in] BOOL bRenderer);
  179.  
  180.     HRESULT ReferenceTimeToStreamTime(
  181.         [in] [out] REFERENCE_TIME *pTime);
  182.  
  183.     HRESULT GetCurrentStreamTime(
  184.         [out] REFERENCE_TIME *pCurrentStreamTime);
  185.  
  186.     HRESULT WaitUntil(
  187.         [in]  REFERENCE_TIME WaitStreamTime);
  188.  
  189.     HRESULT Flush(
  190.         [in] BOOL bCancelEOS);
  191.  
  192.     HRESULT EndOfStream();
  193. };
  194.  
  195.  
  196.  
  197. [
  198. object,
  199. local,
  200. uuid(AB6B4AFC-F6E4-11d0-900D-00C04FD9189D),
  201. pointer_default(unique)
  202. ]
  203. interface IDirectDrawMediaSampleAllocator : IUnknown
  204. {
  205.         HRESULT GetDirectDraw(IDirectDraw **ppDirectDraw);
  206. };
  207.  
  208.  
  209. [
  210. object,
  211. local,
  212. uuid(AB6B4AFE-F6E4-11d0-900D-00C04FD9189D),
  213. pointer_default(unique)
  214. ]
  215. interface IDirectDrawMediaSample : IUnknown
  216. {
  217.         HRESULT GetSurfaceAndReleaseLock(
  218.                 [out] IDirectDrawSurface **ppDirectDrawSurface,
  219.                 [out] RECT * pRect);
  220.         HRESULT LockMediaSamplePointer(void);
  221. };
  222.  
  223.  
  224.  
  225.  
  226.  
  227. [
  228. object,
  229. local,
  230. uuid(AB6B4AFA-F6E4-11d0-900D-00C04FD9189D),
  231. pointer_default(unique)
  232. ]
  233.  
  234. interface IAMMediaTypeStream : IMediaStream
  235. {
  236.         HRESULT GetFormat(
  237.                 [out]   AM_MEDIA_TYPE * pMediaType,
  238.                 [in]    DWORD dwFlags);
  239.  
  240.         HRESULT SetFormat(
  241.                 [in]    AM_MEDIA_TYPE * pMediaType,
  242.                 [in]    DWORD dwFlags);
  243.  
  244.         HRESULT CreateSample(
  245.                 [in]  long lSampleSize,
  246.                 [in]  BYTE * pbBuffer,
  247.                 [in]  DWORD dwFlags,
  248.                 [in]  IUnknown *pUnkOuter,
  249.                 [out] IAMMediaTypeSample ** ppAMMediaTypeSample);
  250.  
  251.         HRESULT GetStreamAllocatorRequirements(
  252.                 [out] ALLOCATOR_PROPERTIES *pProps);
  253.  
  254.         HRESULT SetStreamAllocatorRequirements(
  255.                 [in]  ALLOCATOR_PROPERTIES *pProps);
  256. };
  257.  
  258.  
  259. [
  260. object,
  261. local,
  262. uuid(AB6B4AFB-F6E4-11d0-900D-00C04FD9189D),
  263. pointer_default(unique)
  264. ]
  265. interface IAMMediaTypeSample : IStreamSample
  266. {
  267.     //
  268.     //  Unique methods for IAMMediaTypeSample
  269.     //
  270.     HRESULT SetPointer([in] BYTE *pBuffer, [in] long lSize);
  271.  
  272.     //
  273.     //  Mirror of IMediaSample
  274.     //
  275.     HRESULT GetPointer([out] BYTE ** ppBuffer);
  276.     long GetSize(void);
  277.     HRESULT GetTime([out] REFERENCE_TIME * pTimeStart, [out] REFERENCE_TIME * pTimeEnd);
  278.     HRESULT SetTime([in] REFERENCE_TIME * pTimeStart, [in] REFERENCE_TIME * pTimeEnd);
  279.     HRESULT IsSyncPoint(void);
  280.     HRESULT SetSyncPoint(BOOL bIsSyncPoint);
  281.     HRESULT IsPreroll(void);
  282.     HRESULT SetPreroll(BOOL bIsPreroll);
  283.     long GetActualDataLength(void);
  284.     HRESULT SetActualDataLength(long);
  285.     HRESULT GetMediaType(AM_MEDIA_TYPE **ppMediaType);
  286.     HRESULT SetMediaType(AM_MEDIA_TYPE *pMediaType);
  287.     HRESULT IsDiscontinuity(void);
  288.     HRESULT SetDiscontinuity(BOOL bDiscontinuity);
  289.     HRESULT GetMediaTime([out] LONGLONG * pTimeStart, [out] LONGLONG * pTimeEnd);
  290.     HRESULT SetMediaTime([in] LONGLONG * pTimeStart, [in] LONGLONG * pTimeEnd);
  291. };
  292.  
  293.  
  294. [
  295.     uuid(4E6CDE29-C0C4-11d0-8FF1-00C04FD9189D),
  296.     version(1.0),
  297.     helpstring("DirectShowStream 1.0 Type Library")
  298. ]
  299.  
  300. library DirectShowStreamLib
  301. {
  302.     importlib("stdole32.tlb");
  303.     importlib("stdole2.tlb");
  304.  
  305.     [
  306.         uuid(49c47ce5-9ba4-11d0-8212-00c04fc32c45),
  307.         helpstring("DirectShow Multi Media Stream")
  308.     ]
  309.     coclass AMMultiMediaStream
  310.     {
  311.         [default] dispinterface IDirectShowStream;
  312.     };
  313. };
  314.  
  315.  
  316.  
  317. //
  318. //  The MIDL compiler wants to produce a CLSID for everything defined in
  319. //  our type library, but it also wants to generate huge proxy code,
  320. //  so we use DEFINE_GUID for all other classes.  It has another interesting
  321. //  bug in that it defines CLSID_AMMultiMediaStream within a #ifdef __cplusplus
  322. //  block, so we need to define it outside of that scope.
  323. //
  324.  
  325. cpp_quote("#ifndef __cplusplus")
  326. cpp_quote("EXTERN_C const CLSID CLSID_AMMultiMediaStream;")
  327. cpp_quote("#endif")
  328.  
  329. cpp_quote("DEFINE_GUID(CLSID_AMDirectDrawStream, /* 49c47ce4-9ba4-11d0-8212-00c04fc32c45 */")
  330. cpp_quote("0x49c47ce4, 0x9ba4, 0x11d0, 0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45);")
  331. cpp_quote("DEFINE_GUID(CLSID_AMAudioStream, /* 8496e040-af4c-11d0-8212-00c04fc32c45 */")
  332. cpp_quote("0x8496e040, 0xaf4c, 0x11d0, 0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45);")
  333. cpp_quote("DEFINE_GUID(CLSID_AMAudioData, /* f2468580-af8a-11d0-8212-00c04fc32c45 */")
  334. cpp_quote("0xf2468580, 0xaf8a, 0x11d0, 0x82, 0x12, 0x00, 0xc0, 0x4f, 0xc3, 0x2c, 0x45);")
  335. cpp_quote("DEFINE_GUID(CLSID_AMMediaTypeStream, /* CF0F2F7C-F7BF-11d0-900D-00C04FD9189D */")
  336. cpp_quote("0xcf0f2f7c, 0xf7bf, 0x11d0, 0x90, 0xd, 0x0, 0xc0, 0x4f, 0xd9, 0x18, 0x9d);")
  337.